<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<style>
  .elementA:hover,
    /* 兄弟选择器~ */
  .elementA:hover ~.elementB {
    /* Hover styles for ElementA and ElementB */
    background-color: red;
    color: white;
  }
</style>
<body>
<div class="elementA">元素A</div>
<div class="elementB">元素B</div>

</body>
</html>
